//
//  CNCommentToolbar.h
//  CsdnPlus
//
//  Created by 孟瑞瑞 on 2018/7/11.
//  Copyright © 2018年 CSDN. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <CNBaseTool/CNCategoryHeader.h>

typedef NS_ENUM (NSUInteger, CNKeyboardType) {
    CNKeyboardTypeNone = 0,
    CNKeyboardTypeSystem,
    CNKeyboardTypeSticker,
    CNKeyboardTypeVoice,
};

typedef NS_ENUM(NSUInteger, CNCommentToolbarButtonType) {
    CNCommentToolbarButtonTypeEmotion,//表情
};

@class CNCommentToolbar;
@protocol CNCommentToolbarDelegate <NSObject>

@optional

- (void)commentToolbarDidClickSendButton:(CNCommentToolbar *)commentToolbar;

- (void)commentToolbar:(CNCommentToolbar *)toolbar didClickButton:(CNCommentToolbarButtonType)buttonType;

- (BOOL)commentToolbarShouldBeginEditing:(CNCommentToolbar *)commentToolbar;

- (void)commentToolbarDidEndEditing:(CNCommentToolbar *)commentToolbar;

- (void)commentToolbarDidChange:(CNCommentToolbar *)commentToolbar;
- (void)commentToolbarDidClinkAtButton:(CNCommentToolbar *)commentToolbar;
@end

@interface CNCommentToolbar : UIView

@property (nonatomic, weak) id<CNCommentToolbarDelegate> delegate;

@property (nonatomic, strong) PPButton *emojiToggleButton;

@property (nonatomic, strong) PPStickerTextView *textView;

@property (nonatomic, strong, readonly) NSString *plainText;

@property (nonatomic, strong) PPButton *atButton;

@property (nonatomic, assign) BOOL hideAt;
- (void)setAtButtonHidden:(BOOL)hidden;
- (void)clearText;

- (void)showKeyBoard;

- (void)addText:(NSString *)text;
- (void)refreshTextViewWithText:(NSString *)text;


@end
